package nl.depository.pim.entities;

import java.util.List;

import javax.persistence.Id;

import org.joda.time.Duration;
import org.joda.time.LocalDateTime;

public class Task extends MetaNode
{
	@Id
	private String id;
	
	private String title;
	
	private EditorText contents;
	
	private LocalDateTime deadline;
	
	private Duration repeats;
	
	private int priority;
	
	private int completionPercentage;
	
	private Duration timeSpent;
	
	private State state = State.NEW;
	
	private List<Contact> assignees;
	
	private List<Task> subTasks;
	
	public String getId()
	{
		return id;
	}
	
	public String getTitle()
	{
		return title;
	}

	public void setTitle(String title)
	{
		this.title = title;
	}

	public EditorText getContents()
	{
		return contents;
	}

	public void setContents(EditorText contents)
	{
		this.contents = contents;
	}

	public LocalDateTime getDeadline()
	{
		return deadline;
	}

	public void setDeadline(LocalDateTime deadline)
	{
		this.deadline = deadline;
	}

	public Duration getRepeats()
	{
		return repeats;
	}

	public void setRepeats(Duration repeats)
	{
		this.repeats = repeats;
	}

	public int getPriority()
	{
		return priority;
	}

	public void setPriority(int priority)
	{
		this.priority = priority;
	}

	public int getCompletionPercentage()
	{
		return completionPercentage;
	}

	public void setCompletionPercentage(int completionPercentage)
	{
		this.completionPercentage = completionPercentage;
	}

	public Duration getTimeSpent()
	{
		return timeSpent;
	}

	public void setTimeSpent(Duration timeSpent)
	{
		this.timeSpent = timeSpent;
	}

	public State getState()
	{
		return state;
	}

	public void setState(State state)
	{
		this.state = state;
	}

	public List<Contact> getAssignees()
	{
		return assignees;
	}

	public void setAssignees(List<Contact> assignees)
	{
		this.assignees = assignees;
	}

	public List<Task> getSubTasks()
	{
		return subTasks;
	}

	public void setSubTasks(List<Task> subTasks)
	{
		this.subTasks = subTasks;
	}

	public enum State
	{
		NEW, PENDING, IN_PROGRESS, COMPLETED, POSTPONED, ARCHIVED;
	}
}
